﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.ApplicationModel;

namespace CompanyHub.Utilities
{
    public static class PackageVersionHelper
    {
        public static string VersionToString(PackageVersion version)
        {
            return String.Format("{0}.{1}.{2}.{3}",
                                version.Major,
                                version.Minor,
                                version.Build,
                                version.Revision);
        }

        public static bool IsNewer(string newVersion, string oldVersion)
        {
            var newVer = Version.Parse(newVersion);
            var oldVer = Version.Parse(oldVersion);

            return newVer.CompareTo(oldVer) > 0;
        }
    }
}
